<?php
namespace app\common\behavior;

use think\Request;
load_trait('controller/Jump');
class CheckPlatform
{
    use \traits\controller\Jump;
    public function run(&$params)
    {
        if($params['module'][0] == '' || $params['module'][0] == 'index' || $params['module'][0] == 'home'){
            $is_ajax = Request::instance()->isAjax();
            if($is_ajax === false){
                if(is_mobile()){
                    $params['module'][0] = 'index';
                }else{
                    $params['module'][0] = 'home';
                }
                return $params;
            }
        }
    }
}



?>